@import "./variable.scss";

body {
    margin: 0;
    padding: 0;
    color: #000;
    font-size: 14px;
    font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, \\5FAE\8F6F\96C5\9ED1, Arial, sans-serif;
    &.qingmingjie {
        filter: grayscale(100%);
    }
    * {
        box-sizing: border-box;
    }
    ul {
        list-style: none;
        padding: 0;
    }
    .link {
        cursor: pointer;
        color: $themeColor;
        text-decoration: none;
        &:hover {
            text-decoration: underline;
        }
    }
    p {
        margin: 14px 0;
        font-size: 14px;
    }
}
.due-to-stop {
    color: red;
}
.end-of-life {
    color: #c0c4cc;
    text-decoration: line-through;
}
.red {
    color: red;
}
.green {
    color: green;
}
.orange {
    color: orange;
}
html,
body,
#app {
    height: 100%;
    overflow: hidden;
}
#app {
    display: flex;
    flex-direction: column;
}
.upgrade {
    text-align: right;
    .link {
        margin-left: 20px;
    }
}
.content {
    h2 {
        margin: 30px 0 0.8em;
        padding-bottom: 0.7em;
        border-bottom: 1px solid #ddd;
    }
    p {
        &.tip {
            border-left: 4px solid $themeColor;
            padding: 12px 24px 12px 30px;
            margin: 2em 0;
            background-color: #f8f8f8;
        }
        &.warn {
            border-left: 4px solid red;
            padding: 12px 24px 12px 30px;
            margin: 2em 0;
            background-color: #f8f8f8;
        }
    }
}

.page-header {
    flex-shrink: 0;
    height: 48px;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #dcdfe6;
    box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.12);
    display: flex;
    color: #fff;
    background-color: #24292e;
    &:after {
        content: "";
        display: block;
        clear: both;
        visibility: hidden;
    }
    .logo {
        float: left;
        width: 30px;
        height: 30px;
        margin: 12px 4px 0 0;
        border-radius: 50%;
    }
    .title {
        padding: 0 0.4em;
        font-weight: 700;
        color: #fff;
    }
    .left {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        font-size: 22px;
        a {
            color: $themeColor;
            text-decoration: none;
            cursor: pointer;
            img {
                vertical-align: middle;
            }
        }
    }
    .main {
        display: flex;
        flex-shrink: 0;
        align-items: center;
        padding: 0 100px;
        .api-search {
            position: relative;
        }
        .search-list {
            position: absolute;
            top: 40px;
            left: 0;
            width: 400px;
            z-index: 99;
            padding: 10px;
            border-radius: 4px;
            border: 1px solid #444;
            background-color: #fff;
        }
    }
    .right {
        display: flex;
        flex-grow: 1;
        align-items: center;
        text-align: right;
        & > .content {
            width: 100%;
            text-align: right;
            & > select,
            & > input {
                height: 24px;
            }
        }
    }
    .performance {
        margin-right: 15px;
    }
    .locale-switch,
    .version-switch {
        margin-left: 10px;
        margin-right: 15px;
    }
    .locale-switch {
        width: 70px;
    }
    .version-switch {
        width: 160px;
    }
    .donation,
    .support {
        padding: 3px 15px;
        border-radius: 15px;
        user-select: none;
    }
    .donation {
        color: #fff;
        background-color: green;
    }
    .support {
        position: relative;
        color: #333;
        margin-left: 10px;
        background-color: #f6ca9d;
        &.is-disabled {
            color: #666;
            background-color: #d6cabd;
            cursor: no-drop;
            &:after {
                display: none;
            }
        }
        &:after {
            content: "";
            position: absolute;
            top: -2px;
            right: -2px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: red;
        }
    }
    .desc {
        font-size: 14px;
        color: #333;
    }
}
.page-container {
    display: flex;
    flex-grow: 1;
    border-bottom: 1px solid #dcdfe6;
    overflow: hidden;
    > .aside {
        position: relative;
        display: flex;
        flex-direction: column;
        width: 0;
        flex-shrink: 0;
        user-select: none;
        padding-top: 10px;
        border-right: 1px solid #dcdfe6;
        overflow: hidden;
        transition: width 0.3s;
        &.visible {
            width: 300px;
        }
        ul {
            padding: 0;
            margin: 0;
        }
        & > .header {
            flex-shrink: 0;
            text-align: center;
            width: 300px;
            .version-list {
                font-size: 12px;
                margin-bottom: 10px;
                & > .title {
                    font-weight: 700;
                    margin: 0 6px;
                }
                .stable-select {
                    width: 74px;
                }
                .latest-select {
                    width: 105px;
                }
            }
            .search-input {
                height: 34px;
                margin-bottom: 10px;
                width: 180px;
            }
        }
        & > .body {
            width: 300px;
            flex-grow: 1;
            overflow-y: scroll;
            overflow-x: hidden;
            padding: 0 0 15px 20px;
            .sponsors {
                margin-bottom: 10px;
                .title {
                    color: #4f5959;
                }
            }
        }
        .search-nodata {
            text-align: center;
            padding: 20px 0;
        }
        .nav-menu {
            color: #333;
            text-decoration: none;
            font-size: 17px;
            margin: 0;
            padding: 0;
            .nav-link {
                display: block;
                height: 40px;
                line-height: 40px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                color: #111;
                &.active {
                    font-weight: 700;
                }
                &.disabled {
                    color: #c0c4cc;
                    cursor: not-allowed;
                }
            }
            .expand {
                .nav-link-icon {
                    transform: rotate(90deg);
                }
            }
            .nav-link-icon {
                display: inline-block;
                margin-right: 5px;
                transition: transform 0.2s ease-in-out;
            }
        }
        .nav-child-menu {
            font-size: 15px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            font-weight: 400;
            > li {
                padding-left: 22px;
            }
            .nav-link {
                display: block;
                height: 30px;
                line-height: 30px;
                &.router-link-active,
                &:hover {
                    color: $themeColor;
                }
                &.router-link-active {
                    font-size: 16px;
                    font-weight: 700;
                }
                &.disabled {
                    color: #c0c4cc;
                    cursor: not-allowed;
                }
            }
        }
        .nav-link {
            color: #444;
            cursor: pointer;
            text-decoration: none;
        }
        .is-warn {
            .nav-link {
                font-size: 15px;
                font-weight: 700;
                color: red;
                &.router-link-active {
                    font-size: 16px;
                    color: red;
                }
            }
        }
        .is-donation {
            .nav-link {
                font-size: 15px;
                font-weight: 700;
                color: green;
                &.router-link-active {
                    font-size: 16px;
                    color: green;
                }
            }
        }
        .is-bad {
            .nav-link {
                color: #f56c6c;
                text-decoration: line-through;
                &:hover,
                &.router-link-active {
                    color: #f14444;
                    text-decoration: line-through;
                }
            }
        }
    }
    > .oper-wrapper {
        position: relative;
        width: 16px;
        .oper-btn {
            position: absolute;
            left: 0;
            top: 50%;
            height: 60px;
            user-select: none;
            padding: 0;
            cursor: pointer;
            border: 1px solid #e4e4e4;
            background: #ffffff;
            &:active {
                outline: 0;
            }
        }
    }
    > .body {
        display: flex;
        position: relative;
        flex-grow: 1;
        overflow: hidden;
        & > .content {
            width: 100%;
            flex-flow: 1;
            position: relative;
            margin: 0 auto;
            padding: 15px 25px 25px 25px;
            overflow: auto;
            &:not(.full) {
                padding: 15px 10% 25px 10%;
                min-width: 800px;
            }
        }
        .full {
            .todemo {
                display: none;
            }
        }
        .todemo {
            position: absolute;
            top: -30px;
            right: 30px;
            font-size: 16px;
            font-weight: 700;
            i {
                margin-right: 2px;
            }
        }
    }
}

.btn {
    outline: 0;
    margin: 0 10px 10px 0;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    color: #606266;
    background-color: #fff;
    cursor: pointer;
    &:active {
        border-color: $themeColor;
    }
}

.demo-code {
    cursor: pointer;
    font-size: 15px;
    color: $themeColor;
    font-weight: bold;
    text-align: center;
    user-select: none;
    &:before {
        content: ">> ";
    }
    &:hover {
        text-decoration: underline;
    }
    & + pre {
        display: none;
        &.is-show {
            display: block;
        }
    }
}

.search-input {
    width: 300px;
}

.keyword-lighten {
    color: #000;
    background-color: #ffff00;
}

.api-table {
    .vxe-body--row {
        .vxe-body--column {
            &.api-abandoned {
                color: #70541c;
                background-color: #fffbe5;
                .compatibility {
                    background-color: #70541c;
                }
            }
            &.api-disabled {
                cursor: no-drop;
                color: #cb2431;
                background-color: #fbb1b1;
                .compatibility {
                    background-color: #cb2431;
                }
            }
            &.api-pro {
                color: #409eff;
                font-weight: 700;
            }
        }
    }
    .disabled-line-through {
        text-decoration: line-through;
    }
    .pro,
    .compatibility {
        border-radius: 10px;
        padding: 2px 8px;
        color: #fff;
        font-size: 12px;
    }
    .pro {
        color: #333;
        background-color: #f6ca9d;
    }
    .compatibility {
        background-color: #1081c2;
    }
}

.support-declare {
    padding: 10px 0 10px 15px;
}
.support-question {
    padding-left: 20px;
    & > li {
        line-height: 24px;
    }
}
.support-help-icon {
    cursor: help;
}
.support-group {
    width: 300px;
    margin: 20px auto 15px auto;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.support-group-item {
    border-right: 1px solid #ddd;
    padding: 15px 0 20px 0;
    &:last-child {
        border-right: 0;
    }
}
.support-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 32px;
}
.support-price {
    line-height: 36px;
    font-size: 20px;
    font-weight: 700;
    color: #ff6700;
}
.support-original-price {
    font-weight: normal;
    padding-left: 10px;
    text-decoration: line-through;
}
.support-btn {
    width: 80%;
}
.support-describe {
    margin: 0;
    padding: 5px;
    list-style: none;
    text-align: center;
    & > li {
        padding: 0;
    }
}
.support-pay-step {
    text-align: center;
    & > .title {
        font-size: 16px;
        font-weight: 700;
        color: red;
    }
}
.price-help-icon {
    font-size: 14px;
    color: #606266;
    margin-left: 5px;
    cursor: help;
}
.template-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 32px;
}
.template-describe {
    margin: 0;
    padding: 5px;
    list-style: none;
    text-align: left;
    font-size: 12px;
    & > li {
        padding: 0 5px 0 20px;
    }
}
